package com.wedimob.scrapper.parser;

import org.jsoup.nodes.Document;

import com.wedimob.scrapper.data.Content;

/**
 * Content decorator.
 * 
 * @author melouadi
 * 
 */
public class HTMLDocument extends Content {

	/**
	 * parsed document.
	 * 
	 */
	private Document document;

	/**
	 * constructor.
	 * 
	 * @param content
	 *            content
	 */
	public HTMLDocument(final Content content) {
		super(content);
		if (content.getError() == null) {
			try {
				this.document = content.getResponse().parse();
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
	}

	/**
	 * 
	 * @return document
	 */
	public final Document getDocument() {
		return document;
	}

}
